package YAVMM::Drive;
use Moose;
use MooseX::Storage;

our $VERSION = '0.01';

use YAVMM::Types;

with Storage ('format' => 'JSON');

has 'macaddr' => (
    is      => 'rw',
    isa     => 'Str', # TODO: Add MAC Addr type
);

has 'script' => (
    is      => 'rw',
    isa     => 'Str',
    default => 'no',
);

has 'ifname' => (
    is      => 'rw',
    isa     => 'Str',
    default => '',
);

has 'fd' => (
    is      => 'rw',
);

has 'downscript' => (
    is      => 'rw',
    isa     => 'Str',
    default => 'no',
);

has 'model' => (
    is      => 'rw',
    isa     => 'Str',
    default => 'e1000',
);

has 'qvlan' => (
    is      => 'rw',
    isa     => 'Str',
    default => 0,
);

has 'name' => (
    is      => 'rw',
    isa     => 'Str',
    default => '',
);

has 'mode' => (
    is      => 'rw',
    isa     => 'Str',
    default => 'tap',
);

has 'socket' => (
    is      => 'rw',
    isa     => 'Str',
    default => '',
);

has 'vde_port' => (
    is      => 'rw',
    isa     => 'Int|Undef'
);

sub TO_JSON { return $_[0]->pack; }

1;
